#include "DlpModuleView.h"
#include "F3LampInterfaces.h"

void execute_dlpView(DlpModelView* this_)
{
    if(this_->model_->isDLP_LED1_And_DLP_LED2_Enable_ && this_->model_->DO_S32K_SL3409_PWM_)
    {
        Set_DO_S32K_SL3409_PWM(this_->model_->DO_S32K_SL3409_PWM_);
        Set_LM3409_EN(true);
    }
    else
    {
        Set_DO_S32K_SL3409_PWM(0);
        Set_LM3409_EN(false);
    }

    if(this_->model_->angle_ != this_->lastModel_.angle_)
    {
        switch(this_->model_->angle_)
        {
        case ProjectionAngle_Level0:
            Set_MotorCtrl_ProjectionAngle(0.0);
            break;
        case ProjectionAngle_Level1:
            Set_MotorCtrl_ProjectionAngle(45.5);
            break;
        case ProjectionAngle_Level2:
            Set_MotorCtrl_ProjectionAngle(-4.5);
            break;
        default:
            break;
        }
    }
}
